﻿using System;

namespace CatUtils.Utils.SpecialUtils.UserAgnetHelper
{
    internal class FireFoxUserAgent
    {
        /// <summary>
        /// 获取WindowsHeader
        /// </summary>
        public string WindowsHeader = WindowsSetVersion(72);

        /// <summary>
        /// 获取随机的Windows Header
        /// get random Windows header
        /// </summary>
        /// <returns></returns>
        public static string RandomWindowsHeader()
        {
            return WindowsSetVersion(new Random().Next(50, 85));
        }

        /// <summary>
        /// 设置指定版本的WindowsHeader
        /// WindowsHeader SetVersion
        /// </summary>
        /// <param name="Version"></param>

        /// <returns></returns>
        public static string WindowsSetVersion(double Version)
        {
            string VirsionText = Version.ToString("0.0");//需要格式化具体版本
            return $"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:{VirsionText}) Gecko/20100101 Firefox/{VirsionText}";
        }
    }
}